﻿using System.Text.Json.Serialization;

namespace Digitalmes.Application.Common.Models;

/// <summary>
/// 消息推送数据。
/// </summary>
public sealed class PushMessageData
{
    /// <summary>
    /// 数据推送模式
    /// </summary>
    public MessagePushMode Mode { get; set; }

    /// <summary>
    /// 数据行为。
    /// </summary>
    public string Action { get; set; } = string.Empty;

    /// <summary>
    /// 消息数据
    /// </summary>
    public object? Data { get; set; }
}

/// <summary>
/// 消息推送模式
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter<MessagePushMode>))]
public enum MessagePushMode
{
    /// <summary>
    /// 增量更新
    /// </summary>
    Incremental,

    /// <summary>
    /// 全量更新
    /// </summary>
    Full,
}
